home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / emerald / emrldsys.lha / Language / ExecTests / Makefile next >
Makefile  |  1990-08-31  |  3KB  |  115 lines

  1. SOURCES = t*.m
  2. TARGETS = t*.g
  3. .SUFFIXES:
  4. .SUFFIXES:    .g .m
  5. # (for finding reg problems)
  6. # ECFLAGS = -C -z -Tprimitive=2 -Ttempreg=1 
  7. ECFLAGS = -gt -gd
  8. EMDIR=/scratch/eric/emerald/
  9. EC = ${EMDIR}/Language/Compiler/ec
  10. RUNEC = ${EMDIR}/bin/runec
  11. .m.g:
  12.     ${EC} -C ${ECFLAGS} $*.m
  13.  
  14. all:
  15.     @make -k ${MFLAGS} `echo ${SOURCES} | sed -e 's/\\.m/.g/g'`
  16.  
  17. links:
  18.     csh -c "ln -s /r/bas$(EMDIR)/Language/ExecTests/{*.{m,input,output},Makefile,testshell,t} ."
  19.  
  20. test:    all dotest
  21.  
  22. dotest:
  23.     @-for name in ${TARGETS} ; do \
  24.         bn=`basename $$name .g` ; \
  25.         if  [ -r $$bn.input ] ; then \
  26.         if [ -r $$bn.output ] ; then \
  27.             ${RUNEC} -i  $$bn < $$bn.input > $$bn.output.bak ; \
  28.             if cmp -s $$bn.output $$bn.output.bak ; then \
  29.             echo "Test \"$$bn\" starting ... completed successfully." ; \
  30.             rm $$bn.output.bak ; \
  31.             else \
  32.             echo "Test \"$$bn\" starting ... failed." ; \
  33.             diff -c $$bn.output $$bn.output.bak ; \
  34.             fi ; \
  35.         else \
  36.             ${RUNEC} -i  $$bn < $$bn.input ; \
  37.         fi ; \
  38.         else \
  39.         if [ -r $$bn.output ] ; then \
  40.             ${RUNEC} -i  $$bn > $$bn.output.bak ; \
  41.             if cmp -s $$bn.output $$bn.output.bak ; then \
  42.             echo "Test \"$$bn\" starting ... completed successfully." ; \
  43.             rm $$bn.output.bak ; \
  44.             else \
  45.             echo "Test \"$$bn\" starting ... failed." ; \
  46.             diff -c $$bn.output $$bn.output.bak ; \
  47.             fi ; \
  48.         else \
  49.             ${RUNEC} -i  $$bn ; \
  50.         fi ; \
  51.         fi ; \
  52.         true ; \
  53.     done
  54. print:
  55.     enscript -2 -r -k *.m
  56.  
  57. tar:
  58.     @echo "Making Tests.tar"
  59.     tar cf Tests.tar ${SOURCES} Makefile
  60.  
  61. sources:
  62.     @echo "${SOURCES}"
  63.     
  64. clean:
  65.     @rm -f core *.bak *.ckp *.[0-9].s *.[0-9][0-9].s \
  66.         *.[0-9].o *.[0-9][0-9].o *.g
  67.  
  68. GREP = fgrep -i
  69. G    = import
  70.  
  71. grep:
  72.     @-${GREP} -n -e '${G}' ${SOURCES} | \
  73.     sed 's/^\([^:]*\):\([^:]*\):/"\1", line \2:/'
  74.     @sleep 1
  75.  
  76. depend:
  77.     @echo "Doing .m files"
  78.     @grep -w 'import' ${SOURCES} | \
  79.           grep -v 'Builtins' | \
  80.           sed 's/:[     ]*import[     ][     ]*\([^     ]*\).*/: \1.g/' | \
  81.           sed 's/\.m/.g/' | \
  82.           tr 'A-Z' 'a-z' | \
  83.     awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
  84.         else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
  85.                else rec = rec " " $$2 } } \
  86.           END { print rec } ' > makedep
  87.     @echo "Finishing up"
  88.     @echo '$$r makedep' >>eddep
  89.     @echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >>eddep
  90.     @echo '$$r makedep' >>eddep
  91.     @echo 'w' >>eddep
  92.     @cp Makefile Makefile.bak
  93.     @ed - Makefile < eddep
  94.     @rm eddep makedep
  95.  
  96. # DO NOT DELETE THIS LINE -- make depend uses it
  97.  
  98. taaaa.g: runtest.g
  99. tabstracttype.g: runtest.g
  100. tarray.g: runtest.g
  101. tboolean.g: runtest.g
  102. tcharacter.g: runtest.g
  103. tconform.g: runtest.g
  104. thairy.g: runtest.g
  105. thiho.g: runtest.g
  106. tinstream.g: runtest.g
  107. tinteger.g: runtest.g
  108. tmove.g: runtest.g
  109. tnode.g: runtest.g
  110. toutstream.g: runtest.g
  111. trecord.g: runtest.g
  112. tstring.g: runtest.g
  113. ttime.g: runtest.g
  114. tvector.g: runtest.g
  115.